<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div class="mydiv">
    <input type="button" value="get" onclick="upload()">
    <input type="button" value="put" onclick="put()">
</div>
</body>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
<script>
    $(function () {
        console.log("页面加载完成事件")
    })

    function upload() {
        $.ajax({
            type: 'get',
            url: 'http://localhost:8080/hello',
            success(res) {
                alert(res)
            }
        })
    }

    function put() {
        $.ajax({
            type: 'put',
            url: 'http://localhost:8080/hello',
            success(res) {
                alert(res)
            }
        })
    }
</script>
</html>